---
title: 'GitHub'
icon: 'github'
description: 'Integrate GitHub Single Sign-On with Nile Auth'
---

<Steps>
<Step title="Setup GitHub Developer Portal">

1. Create a [GitHub Developer](https://github.com/settings/developers) account.
2. Follow the documentation for [creating an OAuth App](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app) in GitHub.
3. Obtain a **Client ID** and **Client Secret** from [GitHub OAuth](https://github.com/settings/developers). Be sure to set the redirect URL to your application handling the Nile Auth requests.
   <Accordion title="Github dashboard example">
     <img
       height="500"
       width="500"
       src="/images/auth/githubexample.png"
       alt="Discord SSO"
     />
   </Accordion>

</Step>
<Step title="Save Client ID and Client Secret in Nile">

Save them to your database at `console.thenile.dev` under GitHub in **Tenants & Users -> Configuration**  
![GitHub configuration on console.thenile.dev](/images/singlesignon/github.png)

</Step>

<Step title="Add the `GitHub` button to your login page"> 
The button will redirect the user to GitHub for authentication. Upon successful authentication, the user will be redirected back to your application.

```jsx
import { GitHub } from '@niledatabase/react';

function App() {
  return (
    <div>
      <GitHub callbackUrl="/" />
    </div>
  );
}
```

</Step>
</Steps>

## Related Topics

- [OAuth Concepts](/auth/concepts/oauth)
- [User Management](/auth/concepts/users)
- [Other SSO Providers](/auth/singlesignon/google)
